<?php
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/

define("BIGDADDY_API_URL", "http://bigdaddy/api/");

error_reporting (E_ALL ^ E_NOTICE);

$cronID = $argv[1];
$sOptions = $argv[2];

//Use curl to go fetch the URL and then die if fail, otherwise all good
$url = BIGDADDY_API_URL."?page=SetCronStart&cronID=".$cronID."&option=".$sOptions;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec($ch);
curl_close($ch);

if (substr_count(strtolower($contents), "success") == 0)
{
    echo "Cron Cannot Be Started";
    exit;
}
?>
